import React, { Component } from 'react';
import { Table } from '@icedesign/base';

const Column = Table.Column;
const changeLink = (value, index, record) => {
   // console.log(value, index, record);
   return <a href={record.title_url} title={record.title}>{record.title}</a>;
}
/**
 * 违规扣分表格
 */
export default class DeductTable extends Component {
  static displayName = 'DeductTable';

  static propTypes = {};

  static defaultProps = {};

  constructor(props) {
    super(props);
    this.state = {
    };
  }

  render() {
    const {list, isLoading}= this.props;
    return (
      <div style={{padding: '20px'}}>
        <Table className="deductTable" dataSource={list} isLoading={isLoading} maxBodyHeight={249} fixedHeader={true}>
          <Column title="扣分内容" width="36%" align="center"  onClick={this.onOpen} dataIndex="title" cell={changeLink}/>
          <Column title="处理机构" width="16%" align="center" dataIndex="process_dept"/>
          <Column title="扣分类型" width="16%" align="center" dataIndex="deal_type"/>
          <Column title="扣分时间" width="16%" align="center" dataIndex="deal_time"/>
          <Column title="严重程度" width="16%" align="center" dataIndex="deal_level"/>
        </Table>
      </div>
    );
  }
}
